#ifndef MERGER_H_
#define MERGER_H_



#include "MapToDisk.h" 
#include "SequencialReadPages.h"
#include "WellSizedVector.h"


class Merger {
public:
	WellSizedVector mergeAll(std::vector<WellSizedVector> wsVector) {
	uint capacity = 0;
	WellSizedVector v;
	std::vector<WellSizedVector>::iterator it;
//	uint i = 0;
	for (it = wsVector.begin(); it != wsVector.end(); it++) {
//		cout << "Tamanho[" << i++ << "] = " << it->getVectorSize() << endl; 
//		cout << "Vetor: " << it->listDocs() << endl;
		capacity += it->getVectorSize();
	}
	v.reserve(capacity);
	for (it = wsVector.begin(); it != wsVector.end(); it++) {
		v.insert(it->getDocuments());
	}
	return v;
}


};

#endif /*MERGER_H_*/
